package com.dodoke.service.impl;

import java.util.List;

import com.dodoke.domain.WxAddresss;
import com.dodoke.mapper.WxAddresssMapper;
import com.dodoke.service.IWxAddresssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 【地址】Service业务层处理
 *
 * @author dodoke
 * @date 2020-08-25
 */
@Service
public class WxAddresssServiceImpl implements IWxAddresssService
{
    @Autowired
    private WxAddresssMapper wxAddresssMapper;

    /***
     * 查询【地址】列表
     * @param openId
     * @return
     */
    @Override
    public List<WxAddresss> selectWxAddresssList(String openId) {
        return wxAddresssMapper.selectWxAddresssList(openId);
    }

    /***
     * 查询默认地址
     * @param openId
     * @return
     */
    @Override
    public WxAddresss selectDefaultAddressByOpenId(String openId) {
        return wxAddresssMapper.selectDefaultAddressByOpenId(openId);
    }

    @Override
    public void updateAddressByOpenId(String openId) {
        wxAddresssMapper.updateAddressByOpenId(openId);
    }

    @Override
    public void insertAddressInfo(WxAddresss wxAddresss) {
        wxAddresssMapper.insertAddressInfo(wxAddresss);
    }

    @Override
    public int getUserIdByOpenId(String openId) {
        return wxAddresssMapper.getUserIdByOpenId(openId);
    }

    @Override
    public int deleteAddressById(Long id) {
        return wxAddresssMapper.deleteAddressById(id);
    }

    @Override
    public WxAddresss selectAddressById(Long id) {
        return wxAddresssMapper.selectAddressById(id);
    }

    @Override
    public int updateAddressById(WxAddresss wxAddresss) {
        return wxAddresssMapper.updateAddressById(wxAddresss);
    }
}
